'use strict';
// var URL = 'http://kkgve7.natappfree.cc' //测试全局域名url
var URL = 'https://www.witchat.net' //正式全局域名url

module.exports = {
  URL: URL,
  API_GETSTORELST: URL + '/web/appcard/getStoreLst',//门店列表
  //API_GETCOACHLST: URL + '/web/appcard/getCoachLst', 
  
 
  $post(url, data) {
    return new Promise((resolve, reject) => {

      wx.showLoading({
        title: '加载中...', //全局设置加载中
      });

      wx.request({
        url: url,
        data: data,
        method: 'POST',
        header: { 
          'Content-Type': 'application/x-www-form-urlencoded', 
        },
        success: function (res) { 
          resolve(res.data); 
          wx.hideLoading();
          
        },
        fail: function (res) {
          reject(res.data)
        }
      })
    })
  },
  $get(url, data) {
    return new Promise((resolve, reject) => {  

      wx.showLoading({
        title: '加载中...', //全局设置加载中
      });
      wx.request({
        url: url,
        data: data,
        method: 'GET',
        header: {
          'Content-Type': 'application/x-www-form-urlencoded', 
        },
        success: function (res) { 
          resolve(res.data);
          wx.hideLoading();
         
        },
        fail: function (res) {
          reject(res.data)
        }
      })
    })
  },
};
